package org.swfer.test 
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import org.swfer.UIC.Button;
	import org.swfer.UIC.Dialog;
	import org.swfer.UICExtend.Singleton;
	
	/**
	 * ...
	 * @author swfer
	 */
	public class Test_Dialog extends BaseTest 
	{
		
		private var dialog:Dialog;
		
		public function Test_Dialog() 
		{
		}
		
		override protected function toDo():void
		{
			var btn:Button = new Button(Singleton.skinManager.getSkin('ButtonSkin'));
			btn.view.addEventListener(MouseEvent.CLICK, onClick);
			btn.view.x = 200;
			btn.view.y = 200;
			btn.label = '点击测试弹出框';
			addChild(btn.view);
			
			dialog = new Dialog(Singleton.skinManager.getSkin('DialogSkin'));
			dialog.addCallBack(Dialog.SHOW,onShow);
			dialog.addCallBack(Dialog.HIDE,onHide);
			
			Singleton.dialogManager.dialogLayer = this;
		}
		
		private function onShow(target:Dialog):void
		{
			trace('dialog show');
		}
		
		private function onHide(target:Dialog):void
		{
			trace('dialog hide');
		}
		
		private function onClick(e:MouseEvent):void 
		{
			dialog.show();
		}
		
	}

}